*******************************************************************************
*****************************  TABLE A11  *************************************
*****  Effect of Formal Leadership on Women's Influence, Study 2  *************
*******************************************************************************

clear all
set more off

//cd "C:/Users/ganth/Dropbox/StrengthInNumbersReplicationPackage/replicable/table_a11"

*******************************************************************************

use "table_a11_dataset.dta", clear

eststo clear
eststo: reg genderminfl_ratio_r1 maleMajority, robust
estadd ysumm
eststo: reg genderminfl_ratio_r2 fem_leader, robust
estadd ysumm
eststo: reg genderminfl_ratio_r2 maleMajority fem_leader, robust
estadd ysumm
esttab _all using "table_a11_panel_1.tex", style(tex) ///
 stats(ymean ysd, fmt(%9.2f %9.2f) ///
labels("Mean of outcome" "St. dev. of outcome")) label replace ///
keep(maleMajority fem_leader) ///
star( * .1 ** .05 *** .01) b(%9.3f) se(%9.3f) nogaps  ///
mtitles("Pre-leader" "Post-leader" "Post-leader") ///
nonotes nonum 

eststo clear
eststo: reg genderspokes_ratio_r1 maleMajority, robust
estadd ysumm
eststo: reg genderspokes_ratio_r2 fem_leader, robust
estadd ysumm
eststo: reg genderspokes_ratio_r2 maleMajority fem_leader, robust
estadd ysumm
esttab _all using "table_a11_panel_2.tex", style(tex) ///
 stats(ymean ysd, fmt(%9.2f %9.2f) ///
labels("Mean of outcome" "St. dev. of outcome")) label append ///
keep(maleMajority fem_leader) ///
star( * .1 ** .05 *** .01) b(%9.3f) se(%9.3f) nogaps  ///
mtitles("pre-leader" "post-leader" "post-leader") ///
nonotes nonum
 

eststo clear
eststo: reg  femvotesminfl_avgpre_ratio maleMajority  if !mi(genderminfl_ratio_r1), robust
estadd ysumm

eststo: reg  femvotesminfl_avgpost_ratio fem_leader  if !mi(genderminfl_ratio_r1), robust
estadd ysumm
eststo: reg  femvotesminfl_avgpost_ratio maleMajority fem_leader  if !mi(genderminfl_ratio_r1), robust
estadd ysumm
esttab _all using "table_a11_panel_3.tex", style(tex) ///
 stats(ymean ysd, fmt(%9.2f %9.2f) ///
labels("Mean of outcome" "St. dev. of outcome")) label append ///
keep(maleMajority fem_leader) ///
star( * .1 ** .05 *** .01) b(%9.3f) se(%9.3f) nogaps  ///
mtitles("pre-leader" "post-leader" "post-leader") ///
nonotes nonum
 

eststo clear
eststo: reg genderlinfl_ratio_r1 maleMajority, robust
estadd ysumm
eststo: reg genderlinfl_ratio_r2 fem_leader, robust
estadd ysumm
eststo: reg genderlinfl_ratio_r2 maleMajority fem_leader, robust
estadd ysumm
esttab _all using "table_a11_panel_4.tex", style(tex) ///
 stats(ymean ysd, fmt(%9.2f %9.2f) ///
labels("Mean of outcome" "St. dev. of outcome")) label append ///
keep(maleMajority fem_leader) ///
star( * .1 ** .05 *** .01) b(%9.3f) se(%9.3f) nogaps  ///
mtitles("pre-leader" "post-leader" "post-leader") ///
nonotes nonum  addnotes("\begin{minipage}{.7\linewidth} \footnotesize \smallskip \textbf{Note:} Table presents group-level analysis of the effects of majority male groups and women leaders on perceptions of influence. The dependent variable is influence or spokesperson votes for women divided by the proportion of women in the group. Heteroskedasticity-robust standard errors are reported in parentheses. Significance levels are indicated by $*$ $<.1$, ** $<.05$,  *** $<.01$.           \end{minipage} ") 

include "https://raw.githubusercontent.com/steveofconnell/PanelCombine/master/PanelCombine.do"
panelcombine, use(table_a11_panel_1.tex table_a11_panel_2.tex table_a11_panel_3.tex table_a11_panel_4.tex) ///
paneltitles("Team-Building Most Influential Votes" "Team-Building Incentivized Spokesperson Votes" "Global Assessment Most Influential Votes" "Team-Building Least Influential Votes") columncount(4) save("table_a11.tex") cleanup
